package com.tuanzi.loan.core.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.domain.Sort;

import com.tuanzi.loan.core.entity.BaseEntity;

/**
 * @author Ray 2017/09/21
 */
public interface BaseService<T extends BaseEntity, PK extends Serializable> {

    List<T> findAllEnable();

    List<T> findAllDisable();

    T findOne(PK id);

    List<T> findAll();

    List<T> findAll(Sort sort);

    List<T> findAll(List<PK> ids);

    T saveOrUpdate(T t);

    List<T> saveOrUpdate(List<T> t);

    Boolean exists(PK id);

    List<T> disable(List<T> entities);

    T disable(T t);

    List<T> enable(List<T> entities);

    T enable(T t);

    void delete(T t);

    void delete(List<T> entities);
}
